package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.OrderStatisticsService;
import com.atguigu.spzx.model.common.Result;
import com.atguigu.spzx.model.vo.order.OrderStatisticsVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * title:
 * author: zgl
 * date: 2024/1/8
 * description：
 */
@RestController
@RequestMapping("/admin/order/orderStatistics")
@Tag(name = "订单统计管理模块")
public class OrderStatisticsController {
    @Autowired
    private OrderStatisticsService orderStatisticsService;

    @Operation(summary = "查询指定时间区间的订单统计接口")
    @GetMapping("/statisticsList/{begin}/{end}")
    public Result getStatisticsList(@PathVariable String begin, @PathVariable String end) {
        OrderStatisticsVo orderStatisticsVo = orderStatisticsService.getStatisticsList(begin, end);
        return Result.ok(orderStatisticsVo);
    }
}
